opendir $dir, $ARGV[0] or die "can not open the directory $ARGV[0]!\n";
open Output, ">$ARGV[0]\\total.log" or die "$ARGV[0]\\total.log";
$fileNum = 0;
while ($file = readdir $dir) {
	$file_path = "$ARGV[0]\\$file";
	$firstline = 1;
	@oneChannel[6000];
	$sampleNum = 0;
	$match  = "1\.log";
	if($file_path =~ /$match/) {
		$oneChannel[$sampleNum++] = $fileNum+11;
		$fileNum++;
		open fin, "<$file_path" or die "can not open file $file_path!\n";
		while (<fin>) {
			chomp;
			@info = split;
			if($firstline==1) {
				$firstline = 0;
				next;
			}
			$oneChannel[$sampleNum++] = $info[1];
			print "$info[1] \t $sampleNum \t $oneChannel[$sampleNum]\n";
			
		}
		close fin;
		print Output "@oneChannel\n";
	}
}
close Output;
